<?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
<!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="#">首页</a>
                        </li>
                        <li class="active">
                            <a href="<?= BASEURL?>luckydog/broadcast/mybroadcast">系统消息</a>
                        </li>
                    </ul>
                </div>
                <!-- /Page Breadcrumb -->
                <!-- Page Header -->
         
                <!-- /Page Header -->
                <!-- Page Body -->
                <div class="page-body">
                        <div class="page-header position-relative mail-header">
                    <div class="header-title">
                        <h1>
                            系统消息
                        </h1>
                    </div>
                </div>
                <!-- /Page Header -->
                <!-- Page Body -->
                <div class="page-body no-padding">
                    <div class="mail-container">
                       
                        <div class="mail-body" style="margin-left: 0px;">
                            <ul class="mail-list">
                                <li class="list-item unread">
                                    <div class="item-subject" style="left: 10px;">
                                        <a>标题</a>
                                    </div>
                                    <div class="item-time">
                                        发布时间
                                    </div>
                                </li>
                              <?php foreach ($broadcastList as $key => $value):?>
                                <li class="list-item">
                                    <div class="item-subject" style="left: 10px;<?php if($value['publishtime'] == 0):?>font-weight:bolder;<?php endif;?>">
                                        <a href="broadcastdetail?id=<?=$value['id']?>"><?=$value['title']?></a>
                                    </div>
                                    <div style="<?php if($value['publishtime'] == 0):?>font-weight:bolder;<?php endif;?>" class="item-time">
                                        <?=date("Y-m-d H:i", $value['publishtime']);?>
                                    </div>
                                </li>
                            <?php endforeach;?>
                            </ul>
                        </div>
                    </div>
                </div>
                
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /Page Body -->
        </div>
        <!-- /Page Content -->
<script src="<?php echo STATICURL; ?>js/jquery-2.0.3.min.js"></script>
<script src="<?php echo STATICURL; ?>layer/layer.js"></script>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script>
    $(document).ready(function(){
        $(".js_del").click(function(){
            var id = $(this).parent().attr("data_id");
            //判断是否有子分类
            if (confirm("您确定要删除吗？")) {
                $.post("/luckydog/broadcast/do_del", {id:id}, function(data) {  
                        if(data){
                            layer.msg("删除成功");
                            window.location.reload(); 
                        }else{
                            layer.msg("删除失败");
                        }         
                        
                }, "json");
            }
            });     

//发布
        $(".publish").click(function(){
            var id = $(this).parent().attr("data_id");
            if (confirm("您确定要发布广播吗？")) {
                $.post("/luckydog/broadcast/do_publish", {id:id}, function(data) {  
                        if(data){
                            layer.msg("发布成功");
                            window.location.reload();    
                        }else{
                            layer.msg("发布失败");
                        }         
                        
                }, "json");
            }
            }); 
    });
</script>



